package com.mxpio.erp.common.equipment.entity;

import com.mxpio.erp.common.jpa.model.Order;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.Dept;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Author : wpp
 * @Datetime : 2023/12/7 13:43
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_EQP_STATUS_CHANGE")
@Schema(description = "设备台账状态变更申请单")
public class EquipmentEqpStatusChange extends Order {

    @Column(name = "APPLY_TYPE_")
    @Schema(description = "单据类型")
    @Dict(dicCode = "ERP_EQUIPMENT_EQP_STATUS")//变更类型
    private Integer applyType;//等于status

    @Column(name = "APPLY_MAN_")
    @Schema(description = "申请人")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String applyMan;

    @Column(name = "APPLY_DEPT_")
    @Schema(description = "申请部门")
    @Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String applyDept;

    @Schema(description = "备注")
    @Column(name = "MEMO_",columnDefinition = "TEXT")
    private String memo;


    @Override
    public String initTypeCode() {
        return "EC1";
    }

    @Transient
    private List<EquipmentEqpStatusChangeLine> lineList;
}
